# bc <-  read.table ("E:/cell-mac-project/Patients/BC/404.txt");
# fam <-  read.table ("E:/cell-mac-project/Patients/FAM/401.txt");
# control <-  read.table ("E:/cell-mac-project/Patients/Control/2.txt");


bcl <- c(dir("../Patients/BC/", full.names=TRUE))
faml <- c(dir("../Patients/FAM/", full.names=TRUE))
controll <- c(dir("../Patients/Control/", full.names=TRUE))

bcs <- t(mapply(read.table , bcl ))
fams <- t(mapply(read.table , faml))
controls <- t(mapply(read.table , controll))

pdf ("Signal Distribution123.pdf",paper="letter",width=8.5,height=11)
cols <- 2
rows <- 3       
op <- par(mfrow=c(rows,cols))

for (signal in 1:ncol(bc)){
  max = max(unlist(bcs[, signal]), unlist(fams[, signal]), unlist(controls[, signal]), na.rm=TRUE)
  min = min(unlist(bcs[, signal]), unlist(fams[, signal]), unlist(controls[, signal]), na.rm=TRUE)
  
  if (max == Inf)
    max = 1000
  
  plot (0, main=signal-1, ylim=c(min, max), xlim=c(0,80))
  for (j in 1:length(bcl))
    points (bcs[[j, signal]], col="red")
  for (j in 1:length(faml))
    points (fams[[j, signal]], pch=22, col="green")
  for (j in 1:length(controll))
    points (controls[[j, signal]], pch=23, col="blue")
}
dev.off()